This page last changed on Oct 18, 2006 by bowens.

Q: How do I get Tomcat to recognise the data_dir environment variable in Linux?

A: All you have to do to get Tomcat to recognise the environment variable is create a file called setenv.sh and save it in your Tomcat/bin directory. It will be sourced by catalina.sh if it exists.
Then, add the lines:

CATALINA_OPTS="-DGEOSERVER_DATA_DIR=/path/to/my/geoserver/data/directory"
  export CATALINA_OPTS

You can also add some other optional options:

CATALINA_OPTS=" \
    -Xms64m -Xmx1024m \
    -XX:PermSize=32m -XX:MaxPermSize=128m \
    -server \
    -Djava.awt.headless=true \
    -DGEOSERVER_DATA_DIR=/path/to/my/geoserver/data/directory"
  export CATALINA_OPTS
Document generated by Confluence on Jan 16, 2008 23:27